Null(){
    if [ -n "$2" ]; then
      echo "!!! $1 is not null ,please check!"
      exit 1
    fi
    echo ""
}

NotNull(){
    if [ ! -n "$2" ]; then
      echo "!!! $1 is null,please check!"
      exit 1
    fi
    echo ""
}

#1.mkfile path 2.cmdname 3.host
HostNotNull(){
    isLocal=$(grep "$2: " $1 | grep "#" | grep  "\-L" | wc | awk {'print $1'})
    if [ ! -n "$3" -a $isLocal = "0" ]; then
      echo "!!! hosts is null,please check!"
      exit 1
    fi
    echo ""
}

xFile(){
    if [ ! -f $1 ]; then
      echo "!!! $1 is not exists,please check!"
      exit 1
    fi
    echo ""
}

case "$1" in
    'Null')
        shift
        Null $@
        ;;
    'xFile')
        shift
        xFile $@
        ;;
    'NotNull')
        shift
        NotNull $@
        ;; 
    'HostNotNull')
        shift
        HostNotNull $@
        ;; 
    *)
    exit 1
        ;;
    esac
